#ifndef GAME_MANAGER_H
#define GAME_MANAGER_H

#include "State.h"
#include "SFML/Graphics.hpp"
#include <vector>
#include <string>

class GameManager
{
public:
    GameManager(int w = 640, int h = 480, std::string title = "New Window");
    ~GameManager();
    void init();
    void update();
    void handleEvents();
    void render();

    void popState();
    void pushState(State* s);

    void setActiveState(int state);

    void quit() { m_running = false; }

    bool running() { return m_running; }

    int getActiveState() {return m_currentState;}

    sf::RenderWindow& getWindow() { return m_window; }

    void draw(sf::Sprite& s);

    sf::Event& getEvent()
    {
        //m_window.GetEvent(m_event);
        return m_event;
    }


private:
    std::vector<State*> m_states;
    sf::RenderWindow m_window;

    sf::Event m_event;

    bool m_running;
    int m_numStates;
    int m_currentState;
};
#endif
